<div class="form-group">
                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">状态</label>
                        <div class="col-sm-9 col-xs-12">
                             {ife 'creditshop.goods' $item}
                            <label class="radio-inline">
                                <input type="radio" name='status' value="0" {if empty($item['status'])}checked{/if} /> 暂停
                            </label>
                            <label class="radio-inline">
                                <input type="radio" name='status' value="1" {if $item['status']==1}checked{/if} /> 开启
                            </label>
                                {else}
                             <div class='form-control-static'>{if empty($item['type'])}暂停{else}开启{/if}</div>
                             {/if}
                        </div>
                    </div>
                
                   <div class="form-group">
                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">类型</label>
                        <div class="col-sm-9 col-xs-12">
                             {ife 'creditshop.goods' $item}
                            <label class="radio-inline">
                                <input type="radio" name='type' value="0" {if empty($item['type'])}checked{/if} /> 兑换
                            </label>
                            <label class="radio-inline">
                                <input type="radio" name='type' value="1" {if $item['type']==1}checked{/if} /> 抽奖
                            </label>
                                {else}
                             <div class='form-control-static'>{if empty($item['type'])}兑换{else}抽奖{/if}</div>
                             {/if}
                        </div>
                    </div>
                 
                  <div class="form-group">
                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">活动范围说明</label>
                        <div class="col-sm-9 col-xs-12">
                            {ife 'creditshop.goods' $item}
                             <input type='text' class='form-control' name='area' value="{$item['area']}" />
                             <span class='help-block'>不填写默认"全国"</span>
                             {else}
                             <div class='form-control-static'>{$item['area']}</div>
                             {/if}
                        </div>
                    </div>
        <div class="form-group">
                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">运费</label>
                        <div class="col-sm-9 col-xs-12">
                            {ife 'creditshop.goods' $item}
                             <input type='text' class='form-control' name='dispatch' value="{$item['dispatch']}" />
                             <span class='help-block'>全国统一运费，如不填写，则为包邮</span>
                             {else}
                             <div class='form-control-static'>{$item['dispatch']}元</div>
                             {/if}
                        </div>
                    </div>
                   <div class="form-group">
                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">参与数限制</label>
                        <div class="col-sm-6">
                             {ife 'creditshop.goods' $item}
                                  <div class="input-group">
                                   <span class="input-group-addon">每人每天</span>
                             <input type='text' class='form-control' value="{$item['chanceday']}" name='chanceday' />
                              <span class="input-group-addon">次 每人共</span>
                              <input type='text' class='form-control' value="{$item['chance']}" name='chance' />
                              <span class="input-group-addon">次</span>
                             </div>
                              <span class="help-block">空为不限制</span>
                              {else}
                             <div class='form-control-static'>每人{if $item['chance']==-1}无限{else}{$item['chance']}{/if}次机会</div>
                             {/if}
                        </div>
                   </div>
                      <div class="form-group">
                      <label class="col-xs-12 col-sm-3 col-md-2 control-label">商品数限制</label> 
                          <div class="col-sm-6">
                                  <div class="input-group">
                            {ife 'creditshop.goods' $item}
                            <span class="input-group-addon">每天提供</span>
                              <input type='text' class='form-control' value="{$item['totalday']}" name="totalday" />
                              <span class="input-group-addon">份 总共</span>
                              <input type='text' class='form-control' value="{$item['total']}" name="total" />
                              <span class="input-group-addon">份</span>
                              
                             </div>
                                <span class="help-block">空为不限制</span>
                                                           {else}
                             <div class='form-control-static'>总共{if $item['total']==-1}无限{else}{$item['total']}{/if}次机会</div>
                             {/if}
                        </div>
        
                  </div>
                  <div class="form-group">
                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">消耗</label>
                        <div class="col-sm-6">
                              {ife 'creditshop.goods' $item}
                            <div class="input-group">
                                <span class="input-group-addon">消耗</span>
                             <input type='text' class='form-control' value="{$item['credit']}" name='credit'/>
                             <span class="input-group-addon">积分 + 花费</span>
                                <input type='text' class='form-control' value="{$item['money']}" name='money'/>
                              <span class="input-group-addon">元&nbsp;&nbsp;
                                  <label class="checkbox-inline" style='margin-top:-8px;'>
                                    <input type="checkbox" name='usecredit2' value="1" {if $item['usecredit2']==1}checked{/if} /> 优先使用余额支付
                                </label>
                              </span></div>
                              <span class="help-block">可任意组合，可以单独积分兑换，单独现金兑换，或者积分+现金形式兑换</span>
                                                       {else}
                             <div class='form-control-static'>消耗 {$item['credit']} 积分 花费 {$item['money']} 元现金</div>
                             {/if}
                             </div>
                         
                    </div>
                
                   <div class="form-group" id='rate' style="{if empty($item['type'])}display:none{/if}">
                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">抽奖中奖概率</label>
                        <div class="col-sm-3">
                              {ife 'creditshop.goods' $item}
                                  <div class="input-group">
                             <input type='text' class='form-control' value="{$item['rate2']}" name='rate2' />
                              <span class="input-group-addon">分之</span>
                              <input type='text' class='form-control' value="{$item['rate1']}" name='rate1'/>
                             </div>
                              <span class="help-block">同时填写才能生效，否则为中奖几率为0 ,填写相同值（且不等于0）为中奖率100%</span>
                              {else}
                              <div class='form-control-static'>
                                  {if !empty($item['rate1']) && !empty($item['rate2'])}
                                        {if $item['rate1']==$item['rate2']}
                                          必中
                                        {else}
                                        {$item['rate2']}分之{$item['rate1']}
                                        {/if}
                                     {else}
                                     永不中奖
                                     {/if}
                              </div>
                              {/if}
                        </div>
                   </div>
       <div class="form-group" >
                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">使用有效期至</label>
                        <div class="col-sm-9 col-xs-12">
                             {ife 'creditshop.goods' $item}
                                   <label class="checkbox-inline">
                                    <input type="checkbox" name='isendtime' value="1" {if $item['isendtime']==1}checked{/if} /> 限时兑换
                                </label>
                                 {php echo tpl_form_field_date('endtime', $endtime,true)}
                                {else}
                             <div class='form-control-static'>
                                 {if empty($item['isendtime'])}
                                 无时间显示
                                 {else}
                                 兑换之日起至{$endtime}有效
                                 {/if}
                             </div>
                             {/if}
                        </div>
                    </div>
                  <div class="form-group">
                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">兑换流程</label>
                        <div class="col-sm-9 col-xs-12">
                                 {ife 'creditshop.goods' $item}
                             {php echo tpl_ueditor('detail',$item['detail'],array('height'=>200))}
                             {else}
                                <textarea id='detail' style='display:none'>{$item['detail']}</textarea>
                            <a href='javascript:preview_html("#detail")' class="btn btn-default">查看内容</a>
                            {/if}
                        </div>
                    </div>

    <div class="form-group">
                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">注意事项</label>
                        <div class="col-sm-9 col-xs-12">
                                 {ife 'creditshop.goods' $item}
                             {php echo tpl_ueditor('noticedetail',$item['noticedetail'],array('height'=>200))}
                             {else}
                                <textarea id='noticedetail' style='display:none'>{$item['noticedetail']}</textarea>
                            <a href='javascript:preview_html("#noticedetail")' class="btn btn-default">查看内容</a>
                            {/if}
                        </div>
                    </div>

<script language='javascript'>
$(function(){
    
    $(':radio[name=type]').click(function(){
        
        if($(this).val()=='1'){
            $('#rate').show();
        }
        else{
            $('#rate').hide();
        }
        
    })
    
})    
</script>